//
//  Then.swift
//  手账
//
//  Created by zhuxiaoxiang on 2018/11/16.
//  Copyright © 2018年 zhuxiaoxiang. All rights reserved.
//

import Foundation
import UIKit

public protocol Then {}

extension Then where Self: Any {
    public func then( block: (inout Self) -> Void) -> Self {
        var copy = self
        block(&copy)
        return copy
    }
}

extension Then where Self: AnyObject {
    public func then( block: (Self) -> Void) -> Self {
        block(self)
        return self
    }
}

extension NSObject: Then {}

